package com.mall.common;

import com.mall.util.CodeUtil;

import java.io.Serializable;
import java.util.List;


public class WebResult<T> implements Serializable {
	private int code = CodeUtil.ERROR;
	private String msg;
	private T dataSingle;
	private List<T> data;
	private int count = 0;

	public WebResult() {

	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getDataSingle() {
		return dataSingle;
	}

	public void setDataSingle(T dataSingle) {
		this.dataSingle = dataSingle;
	}

	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public void setOK(){
		this.code = CodeUtil.SUCCEED;
	}
	public void setOK(String msg) {
		this.code = CodeUtil.SUCCEED;
		this.msg = msg;
	}

	public void setNo(String msg) {
		this.code = CodeUtil.ERROR;
		this.msg = msg;
	}
}
